package gaml.text;

import gaml.core.GamlConfig;
import gaml.text.printer.AliasNodePrinter;
import gaml.text.printer.EmptyNodePrinter;
import gaml.text.printer.MappingNodePrinter;
import gaml.text.printer.ScalarNodePrinter;
import gaml.text.printer.SequenceNodePrinter;


/**
 * create a new instance of yaml text printers collection
 * and fill it with initial set of yaml node printers
 * @author shnireck
 *
 */
public class DefaultPrinterStoreFactory {
	
	/**
	 * returns new yaml node printer's store with initial set
	 * of yaml node printers
	 * @param config gaml configuration
	 * @return new instance of yaml printers store with basic node printers
	 */
	public static YamlPrinterStore getStore (GamlConfig config) {
		YamlPrinterStore store = new YamlPrinterStore ((YamlNodePrinter) new EmptyNodePrinter (config));
		
		store.register (new AliasNodePrinter (config));
		store.register (new ScalarNodePrinter (config));
		store.register (new SequenceNodePrinter (store, config));
		store.register (new MappingNodePrinter (store, config));
		
		return store;
	}
}
